package com.finance.capacity.siteDetail.capDao;

import com.finance.capacity.siteDetail.bean.pojo.SiteDetail;
import com.finance.capacity.siteDetail.bean.pojo.SiteDetailList;
import com.finance.framework.lang.Page;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.math.BigDecimal;
import java.util.List;

/**
 * The interface Site detail mapper.
 *
 * @Author: ly
 * @Date: Created in 2017/8/24
 */
@Component
public interface SiteDetailMapper {

    /**
     * Maintain list list.
     *
     * @param siteDetailList the site detail list
     * @return the list
     */
    List<SiteDetailList> maintainList(@Param("siteDetail") SiteDetailList siteDetailList);

    /**
     * Cap summary list by page list.
     *
     * @param page the page
     * @return the list
     */
    List<SiteDetail> capSummaryListByPage(Page page);

    /**
     * Export maintain list list.
     *
     * @param siteDetailList the site detail list
     * @return the list
     */
    List<SiteDetailList> exportMaintainList(@Param("siteDetail") SiteDetailList siteDetailList);

    /**
     * Gets site cap info.
     *
     * @param siteDetailId the site detail id
     * @return the site cap info
     */
    SiteDetailList getSiteCapInfo(@Param("siteDetailId") String siteDetailId);

    /**
     * Gets site detail by id.
     *
     * @param id the id
     * @return the site detail by id
     */
    SiteDetailList getSiteDetailById(Long id);

    /**
     * Export summary list list.
     *
     * @param siteDetailList the site detail list
     * @return the list
     */
    List<SiteDetail> exportSummaryList(@Param("siteDetailList") SiteDetailList siteDetailList);

    /**
     * Update site detail int.
     *
     * @param siteDetailList the site detail list
     * @return the int
     */
    int updateSiteDetail(SiteDetailList siteDetailList);

    SiteDetailList computeNewSiteDetail(Long relationId);

    /**
     * Site Capacity Detail List
     *
     * @param siteId
     * @param siteDate
     * @return
     */
    List<SiteDetail> siteCapDetail(@Param("siteId") String siteId, @Param("siteDate") String siteDate);

    int checkSiteDetail(@Param("id") String id, @Param("updateUid") String updateUid, @Param("status") int status);

    BigDecimal getAvgEffOrderNum(@Param("id")String id,@Param("siteDate")String siteDate);

    BigDecimal getMoreAvgEffOrderNum(@Param("id")String id,@Param("siteDate")String siteDate,@Param("avgNum") BigDecimal avgNum);

    BigDecimal getLessAvgEffOrderNum(@Param("id")String id,@Param("siteDate")String siteDate,@Param("avgNum") BigDecimal avgNum);
}
